<%-- 
    Document   : newCocktail
    Created on : 05.06.2012, 08:36:16
    Author     : tamara
--%>

<%@page import="model.Ingredient"%>
<%@page import="java.util.ArrayList"%>
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
    <head>
        <link rel="stylesheet" type="text/css" href="css/main.css">
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title>JSP Page</title>
    </head>
    <body>
        <div class="container">
            <h1>New Cocktail: </h1>

            <form name ="newcocktail" action="NewCocktailServlet">
                Name: <input type="text" name="cocktailname" /><br />
                Zutat:
                <select name="cb_zutat1" size="1">
                    <%
                        ArrayList<Ingredient> ingredients = (ArrayList<Ingredient>) request.getAttribute("ingredients");
                        for (Ingredient ingredient : ingredients) {
                            out.println("<option>" + ingredient.getZutatID() + ' ' + ingredient.getZutatname() + "</option>");;
                        }
                    %>
                </select>
                Menge:<input type="text" name="menge1" />
                Einheit:<input type="text" name="einheit1" /><br/>
                Zutat:
                <select name="cb_zutat2" size="1">
                    <%
                        for (Ingredient ingredient : ingredients) {
                            out.println("<option>" + ingredient.getZutatID() + ' ' + ingredient.getZutatname() + "</option>");;
                        }
                    %>
                </select>
                Menge:<input type="text" name="menge2" />
                Einheit:<input type="text" name="einheit2" /><br/>
                Zutat:
                <select name="cb_zutat3" size="1">
                    <%
                        for (Ingredient ingredient : ingredients) {
                            out.println("<option>" + ingredient.getZutatID() + ' ' + ingredient.getZutatname() + "</option>");;
                        }
                    %>
                </select>
                Menge:<input type="text" name="menge3" />
                Einheit:<input type="text" name="einheit3" /><br/>

                <input type="submit" value="AddNewCocktail" name="btSubmit"> </input>
            </form>
            <INPUT type=button VALUE="back" onClick="history.go(-1)">
        </div>
    </body>
</html>